<extend name="Layout/ins_page" />
<block name="content">
   <link href="/sap/demo.css" rel="stylesheet" type="text/css" />
    <script src="/sap/scripts/boot.js" type="text/javascript"></script>



        <legend><span></span></legend>
        <div  id='fm1'>
        <div class="fieldset-body">
        
   
		<span>物料名称</span>
		<input  class="mini-textbox" id='c_name'  />
		
    <a class="mini-button" onclick="search()" enabled="" id='query-bt'  style="margin-top: 5px">&nbsp;&nbsp;查询&nbsp;&nbsp;</a> 
 
  
   
    <div id="tabs1" class="mini-tabs" activeIndex="0" style="width:100%;margin-top: 5px;overflow:auto;" plain="false"
    buttons="#tabsButtons"
>
    <div title="品牌列表" >
   
   <div id="datagrid1" class="mini-datagrid" style="height:430px;width: 100%;" 
        url="/SapSupplier/getItemListData" idField="id"
        allowResize="true" 
        allowCellEdit="true" allowCellSelect="true" multiSelect="true"
        allowCellValid="true" oncellvalidation="" 
    >
    
        <div property="columns">
           
           <div field="sap_code"  headerAlign="center"  >SAP编号
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
           
             <div field="item_name"  headerAlign="center"  >物料名称
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            <div field="logo"  headerAlign="center"  >Logo
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            
             <div field="pm"  headerAlign="center"  >产品经理
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            
             <div field="color"  headerAlign="center"  >颜色
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            <div field="model"  headerAlign="center"  >型号
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            <div field="specifications"  headerAlign="center"  >规格
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
              <div field="weight"  headerAlign="center"  >重量
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>
            
            
            <div field="brand_name"  headerAlign="center"  >品牌
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>

            <div field="UptodatePurchasePrice"  headerAlign="center"  >采购价格
                <input property="" class="mini-textbox" style="width:100%;" />
            </div>

            <div field="is_serial"  headerAlign="center"  >是否为序列号管理
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
            <div field="is_3c"  headerAlign="center"  >是否为3C
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
           <div field="ordering_day"  headerAlign="center"  >订货周期(天)
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
           <div field="remarkes"  headerAlign="center"  >备注
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
          
            <div field="ctime"  headerAlign="center"  >添加时间
                <input property="" class="mini-textbox" style="width:100%;" />
            </div> 
          
        </div>
    </div>
    </div>
    <!-- <div title="Tab2" iconCls="" >
        2
    </div> -->
</div>
</div>
</div>


</body>
<script type="text/javascript">
        mini.parse();
        var grid = mini.get("datagrid1");
        grid.setPageSize(50);
        grid.on("drawcell", function (e) {
        var record = e.record,
        column = e.column,
        field = e.field,
        value = e.value;

            //格式化日期
            if (field == "ctime") {
                if (mini.isDate(value)) e.cellHtml = mini.formatDate(value, "yyyy-MM-dd HH:mm:ss");
				
            }
            
            if (field == "item_name") {
            	var url="/SapSupplier/itemedit/id/";
                e.cellHtml = '<a href="' + url+record.item_id + '"  target="_blank"  >' +value+ '</a>';
            }
            
            
            if (field == "logo") {
                if(value) {
                    strs = value.split(",");
                    e.cellHtml = '<img src="' + strs[0] + '"  style="width:50px" >';
                }
            }
            
         

        });

        function search(){
        	var c_name = mini.get('c_name').getValue();
        	
        	grid.load({c_name:c_name})
        }
       

        
     

</script>
    </block>

